package com.awei.project.model.enums;
import lombok.Getter;

import java.util.Arrays;


/**
 * @author 小维哥
 * @version 1.2
 */
@Getter
public enum TeamStatusEnum {

        PUBLIC_TEAM("公开", 0),
        PRIVATE_TEAM("私密", 1),
        PASSWORD_TEAM("加密",2);

        private final String text;
        private final int value;

        TeamStatusEnum(String text, int value) {
                this.text = text;
                this.value = value;
        }

        /**
         * 获取值列表
         *
         * @return
         */
        public static TeamStatusEnum getValues(Integer value) {
                if (value == null) {
                        return null;
                }

                return Arrays.stream(TeamStatusEnum.values())
                        .filter(e -> e.getValue()==value)
                        .findFirst()
                        .orElse(null);
        }
}
